<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
  <th:block th:include="include :: header('修改客户跟踪')"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
  <form class="form-horizontal m" id="form-projectCustomerTrack-edit" th:object="${projectCustomerTrack}">
    <input id="trackId" name="trackId" th:field="*{trackId}" type="hidden">
    <div class="form-group">
      <label class="col-sm-3 control-label">回访日期：</label>
      <div class="col-sm-2">
        <input type="text" class="form-control" id="trackDate" name="trackDate" th:value="${#dates.format(projectCustomerTrack.trackDate, 'yyyy-MM-dd')}" readonly required />
      </div>
    </div>
    <div class="form-group">
      <label class="col-sm-3 control-label">回访方式：</label>
      <div class="col-sm-8">
        <select name="trackMode" class="form-control m-b" th:with="type=${@dict.getType('track_mode')}">
          <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{trackMode}"></option>
        </select>
      </div>
    </div>
    <div class="form-group">
      <label class="col-sm-3 control-label">回访结果：</label>
      <div class="col-sm-8">
        <textarea name="trackContent" maxlength="255" class="form-control" rows="5" required>[[*{trackContent}]]</textarea>
      </div>
    </div>
  </form>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript">
  var prefix = ctx + "project/projectCustomerTrack";
  $("#form-projectCustomerTrack-edit").validate({
    focusCleanup: true
  });

  layui.use('laydate', function () {
    layui.laydate.render({
      elem: '#trackDate', //指定元素
      format : 'yyyy-MM-dd',
      theme: 'molv',
      trigger: 'click',
      done: function(value, date, endDate){
        //单独校验出生日期
        $("#form-projectCustomerTrack-edit").validate().element($("#trackDate"));
      }
    });
  });

  function submitHandler() {
    if ($.validate.form()) {
      $.operate.save(prefix + "/edit", $('#form-projectCustomerTrack-edit').serialize());
    }
  }
</script>
</body>
</html>
